import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import { ywUserSelectList } from '@/api/heng/ywManage';
import { ApiSelect } from '@/components/Form';
import util from '@/utils/util';

import { useMessage } from '@/hooks/web/useMessage';
import Ainput from '@/views/bookManage/components/account/Ainput.vue';
import { VxeFormItemProps, VxeGridPropTypes } from '@/components/VxeTable';
import { changeEnd } from 'codemirror';
import { style } from '@logicflow/extension/es/bpmn-elements/presets/icons';

type CheckedType = boolean | string | number;
// BasicColumn[]

// VxeColumnPropTypes.CellRender

/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: 'ms物料编号',
    field: 'mno',
    showOverflow: 'title',
    // filters: [{ data: '' }],
    // filterRender: {
    //   name: 'VxeInput',
    // },
  },

  {
    title: '库位名称',
    field: 'kuWeiName',
    showOverflow: 'title',
    align: 'center',
    width: 140,
  },
  {
    title: '最大数量',
    field: 'num',
    align: 'center',
  },
  {
    title: '创建时间',
    field: 'createTime',
    width: 180,
    align: 'center',
  },
  {
    width: 230,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
];

export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 5,
    field: 'keyword',
    title: '查询',
    itemRender: {
      props: {
        placeholder: '查询',
      },
      name: 'AInput',
    },
  },

  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: 'ms物料编号',
    field: 'mno',
    component: 'Input',
    required: true,
  },
  {
    field: 'kuWeiName',
    label: '库位名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'num',
    label: '最大数量',
    component: 'InputNumber',
    required: false,
  },
];
